package com.yishe.biz.wx.caseinfo;

import com.yishe.mapper.mysql.YsCaseInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author : chusifeng
 * @version :
 * @date :Create in 2021/4/22 12:16
 * @description:课程中心处理SERICE
 * @package com.yishe.biz.wx.caseinfo
 * @className WxCaseInfoBiz
 */
@Service
@Slf4j
public class WxCaseInfoBiz {
    @Resource
    private YsCaseInfoMapper ysCaseInfoMapper;

    public List<Map<String,Object>> getCaseList(Map<String, String> param) {
        List<Map<String,Object>> resList =  ysCaseInfoMapper.getListInfo(param);
        String caseType = param.get("caseType");
        if (StringUtils.isNotBlank(caseType)){
            resList = resList.stream().filter(m ->m.get("caseType").equals(caseType)).collect(Collectors.toList());
        }
        return resList;
    }
}
